import request from '@/api/myRequest'
// 账号列表
function findUsersByPage(start, limit, data) {
  return request({
    url: `/admin/sysAuth/user/findUsersByPage/${start}/${limit}`,
    method: 'POST',
    data
  })
}
// 删除管理用户
function removeUser(id) {
  return request({
    url: `/admin/sysAuth/user/removeUser/${id}`,
    method: 'DELETE'
  })
}
// 新增用户
function saveUserRoles(data) {
  return request({
    url: `/admin/sysAuth/user/saveUserRoles`,
    method: 'POST',
    data
  })
}
// 更新用户
function updateUserRoles(data) {
  return request({
    url: `/admin/sysAuth/user/updateUserRoles`,
    method: 'PUT',
    data
  })
}
// 获取用户明细

function userid(id) {
  return request({
    url: `/admin/sysAuth/user/${id}`,
    method: 'get'
  })
}
// 获取角色列表

function findAllRoles() {
  return request({
    url: `/admin/sysAuth/role/findAllRoles`,
    method: 'get'
  })
}
// 查询角色分页
function findRolesByPage(start, limit) {
  return request({
    url: `/admin/sysAuth/role/findRolesByPage/${start}/${limit}`,
    method: 'GET'
  })
}
// 删除角色
function removeRole(id) {
  return request({
    url: `/admin/sysAuth/role/removeRole/${id}`,
    method: 'DELETE'
  })
}
// 获取所有菜单
function findAllPermissions() {
  return request({
    url: `/admin/sysAuth/permission/findAllPermissions`,
    method: 'GET'
  })
}
// 新增角色/admin/sysAuth/permission/save
function addsave(data) {
  return request({
    url: `/admin/sysAuth/role/saveRolePermissions`,
    method: 'POST',
    data
  })
}
// 修改QUANXIAN

function updateRolePermissions(data) {
  return request({
    url: `/admin/sysAuth/role/updateRolePermissions`,
    method: 'PUT',
    data
  })
}
// 获取用户qx明细

function findRolePermissions(id) {
  return request({
    url: `/admin/sysAuth/role/findRolePermissions/${id}`,
    method: 'GET'
  })
}
export {
  findUsersByPage, removeUser, saveUserRoles, updateUserRoles, userid, findAllRoles, findRolesByPage, removeRole, findAllPermissions, addsave, updateRolePermissions, findRolePermissions
}
